Menu

Build Instructions

As Composight considers itself to be a tools collection we strongly encourage all users to build from source for some reasons.

  • Platforms differ in terms of installed libraries and build tools available
  • Sooner or later you might need to adjust the algorithms to your specific image problem. Composight tools do not support any complicated plug-in mechanism.
  • Composight makes use of VTK, ITK and Qt which are often not provided as binaries that work in combinateion with your preferred development environment (e.g. Visual Studio 2015). Or the binaries are outdated on a (K/X)Ubuntu LTS. You will find basic information on how we built those toolkits as a way to start for your own.

Nevertheless we provide some Windows x64 binaries to play around.

A reasonably stable revision of composight can be found as tar ball in the files section. In order to try the newest development check out from subversion trunk.
http://svn.code.sf.net/p/composight/code/trunk

The latest stable revision is 0.2 and can be obtained here
http://svn.code.sf.net/p/composight/code/tags/0.2.0

General Notes:
ITK 4.8.x or newer is required
composight is not yet ported to VTK 6 and Qt 5

Windows

In order to checkout the sources from SVN we recommend tortoise svn.
You will most likely use http for read-only access.
For a Windows build you will need Microsoft Visual Studio.

Read-Only access using PUTTY SSH/TortoiseSVN

To Just download Composight and build it from source you can either unzip the source package or
1. Install TortoiseSVN
2. Create a Folder in the Windows explorer, right-click on it and TortoiseSVN --> Check out...
3. Enter http://svn.code.sf.net/p/composight/code/trunk

You can skip the next section and continue with the compilation instructions.

Read-Write access using PUTTY SSH/TortoiseSVN

We cite the steps from SVN access for developers and SSH Key Management on the sourceforge.net Wiki.
To generate a SSH key using PuTTY where USERNAME is your sf.net account name:

  1. Install Putty.
  2. Execute the PUTTYGEN.EXE program.
  3. Select the desired key type, "SSH2 DSA", within the "Key" menu or the "Parameters" Section.
  4. Click on the "Generate" button.
  5. Follow the instruction to move the mouse over the blank area of the program in order to create random data used by PUTTYGEN to generate secure keys. Key generation will occur once PUTTYGEN has collected sufficient random data.
  6. Enter USERNAME@shell.sourceforge.net for the key comment, depending on what host the key is for, replacing USERNAME with your SourceForge.net username.
  7. Enter the desired passphrase in the "Key passphrase" and "Confirm passphrase" fields. If the key will be used for automation of operations (i.e. as part of a script), you may choose to omit this step from the key generation process.
  8. Click on the "Save private key" button. Use the resulting dialog to save your private key data for future use. You may use a filename such as SourceForge-Shell.ppk". The .ppk extension is used for PuTTY Private Key files.
  9. Login to your sourceforge.net account
  10. Go to the SSH key posting page on the SourceForge.net site. Copy your public key data from the "Public key for pasting into OpenSSH authorized_keys2 file" section of the PuTTY Key Generator, and paste the key data to the provided form on the SourceForge.net site. Only one Key per line in the textbox, no newline after your key string! Click on the "Save" button to complete the posting process.
  11. Exit the PuTTY Key Generator (PUTTYGEN).
  12. Key data sync to hosts from the SourceForge.net site occurs on regular intervals. Your key data will be synchronized to the designated servers (shell and code repositories) after a short delay.

Set up TortoiseSVN

  1. Install TortoiseSVN
  2. Start Pageant from the PUTTY Programs
    • It will appear as a systray icon in the windows taskbar
    • Right click --> add Key. Navigate to the SourceForge-Shell.ppk you just saved and enter the passphrase.
  3. Test TortoiseSVN with the repo browser
    • Open any Explorer window and right clickt to get the context menu.
    • Tortoise SVN --> Repo-browser
    • replace USERNAME with yours and enter the URL: svn+ssh://USERNAME@svn.code.sf.net/p/composight/code/trunk
    • Check the SSH fingerprint from sourceforge.
      puttygen
    • Check out a working copy to a local folder, try to add a new file and commit with the Tortoise context menu. After entering a commit log message it should work without the need of entering the passphrase.

Once Pageant has to be restarted every time you log in to your Windows account. To automate the Pageant startup, you might follow the instructions on this blog post: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html

Compile Dependencies

We only describe the steps neede for a Visual Studio 2015 build.

Qt 4.8.7

VTK 5.10.1

ITK 4.8.2

Linux

We describe the steps we needed to build composight on a fresh Virtualbox Ubuntu 14.0.4 LTS.

Prerequesites

First try to install the basic build tools and then compile ITK and VTK. Using the Qt 4 version of your Linux distribution will safe lots of time. If you run into trouble try to find compilation help for VTK and ITK first.

  1. Install all basic build tools, CMake (2.8.12 tested, you will not have to build it from source) and Qt 4.8.
    sudo apt-get install build-essential
    sudo apt-get install cmake-qt-gui
    sudo apt-get install libqt4-designer libqt4-dev qt4-dev-tools
    sudo apt-get install subversion

  2. Setup a build directory in your ${HOME} directory and a directory for installing all VTK/ITK/Composight binaries.
    cd
    mkdir devel
    mkdir local
    cd devel

  3. Download the source tarball of

    and put them inside ${HOME}/devel. Unpack the archives so you have something like
    ${HOME}/devel/VTK5.10.1
    ${HOME}/devel/InsightToolkit-4.8.0/

Building Dependencies

ITK

Fist make an build directory inside the source folder that we name 'release'. Then start CMake GUI. We will configure it to make an optimized build and to install itself into ${HOME}/local/ so you do not need any root access and can not accidentally mess up the system.

cd ${HOME}/devel/InsightToolkit-4.8.0/
mkdir release
cd release

Befor running CMake GUI it is necessary to tell cmake we want to use C++11 befor any default test run. This can only be done by running the command line client cmake:

cmake -DCMAKE_CXX_FLAGS='-std=c++11' ..
cmake-gui ..

In CMake GUI:

  • Press [Configure]
  • Choose 'Unix Makefiles' generator.
  • For now just disable the BUILD_EXAMPLES and BUILD_TESTING options which take a long time to compile.
  • Check 'Advanced' view options and change the following build options:
  • CMAKE_BUILD_TYPE= Release
  • Module_ITKReview= checked
  • CMAKE_INSTALL_PREFIX= /home/your-user-name/local/
  • Press [Configure] and then [Generate] button and wait

If no errors occured you can close CMake GUI and start the build from the shell:
make -j number_of_cpu_cores
make install -j number_of_cpu_cores
will make ITK available for other projects in ${HOME}/local/lib/cmake/ITK-4.8.
You can use it not only fo composight, but also elastix, RTK, etc.

VTK

Shortcut If you do not want to debug into VTK code you can try the distributions package first. For Ubuntu LTS 14.04 it's vtk 5.8:
sudo apt-get install libvtk5.8-qt4 libvtk5-dev

Start with creating a build folder within the VTK directory.
cd ${HOME}/devel/VTK5.10.1/
mkdir release
cd release
cmake-gui ..

In CMake GUI:

  • [Configure]
  • Choose 'Unix Makefiles' generator.
  • For now just disable the BUILD_EXAMPLES and BUILD_TESTING options which take a long time to compile.
  • Check 'Advanced' view options and change the following build options:
  • CMAKE_BUILD_TYPE= Release
  • CMAKE_INSTALL_PREFIX= /home/your-user-name/local/
  • VTK_USE_QT= checked
  • Press [Configure] button and wait
  • Search for CMAKE_CXX_FLAGS. Add -DGLX_GLXEXT_LEGACY to the CMAKE_CXX_FLAGS text field on the right. (command line: cmake -DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY)
  • [Configure]

Back on the console run
make -j number_of_cpu_cores

If all went well you can install composight into your home folder
make -j 4 install

Building Composight

  1. Checkout Composight from subversion at its latest revision [rHEAD].
    cd ${HOME}/devel/
    svn co http://svn.code.sf.net/p/composight/code/trunk ./composight/
    Or get the stable tar archives from []
  2. Build Composight
    cd ${HOME}/devel/composightmkdir releasecd releasecmake -DCMAKE_CXX_FLAGS='-std=c++11' ..cmake-gui ..`

In CMake GUI:

  • set ITK_DIR to ${HOME}/local/lib/cmake/ITK-4.8
  • set VTK_DIR to ${HOME}/local/lib/cmake/VTK-5.10.1 if you compiled your own. If you took the distributors vtk it will probably found automatically (/usr/lib/vtk-5.8)
  • [Configure]
  • [Generate]

Back on the console run
make -j number_of_cpu_cores

If all went well you can install composight into your home folder
make -j 4 install

In order to launch without specifying the absolute path every time we recommend to set the $PATH variable (e.g. in ~/.bashrc)
export PATH=${HOME}/local/bin:$PATH

ITK/VTK are static builds so it is not necessary to specify their location in order to run composight programs.Try to start cpsSegmentGUI from the console as a first test and have fun...

SVN+SSH access from Unix

If you want to contribute as a developer you have to use the SSH access to the svn server
It is convenient to store a public SSH key with your sourceforge account:
https://sourceforge.net/p/forge/documentation/SSH%20Keys/

The repository URL is then
svn+ssh://YOUR_SOURCEFORGE_NAME@svn.code.sf.net/p/composight/code/

Trouble Shooting

  • Show all the commands including compiler calls:
    make VERBOSE=1
  • ITK produced some errors when linking itkTestDriver. For some reason it helped to run make clean && make itkTestDriver after activating and deactivating BUILD_TESTING (plus [Generate] each time). Using the system libjpeg, libpng and libtiff did not work out well.

Mac OS X

Tested Build environment:
- Mac OS X 10.10.5 Yosemite
- CMake 3.3.0
- XCode 7.2
- ITK 4.8.2 compiled from source
- Qt 4.8.6 provided by mac ports: qt4-mac @4.8.6_0
- VTK 5.10.1 provided by mac ports: vtk5 @5.10.1_2+qt4_mac


Related

Composight Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.